package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.DeviceStatusPccMapper;
import com.ruoyi.net.domain.DeviceStatusPcc;
import com.ruoyi.net.service.IDeviceStatusPccService;

/**
 * 设备状态-PCC状态Service业务层处理
 * 
 * @author tony
 * @date 2024-12-11
 */
@Service
public class DeviceStatusPccServiceImpl implements IDeviceStatusPccService 
{
    @Autowired
    private DeviceStatusPccMapper deviceStatusPccMapper;

    /**
     * 查询设备状态-PCC状态
     * 
     * @param id 设备状态-PCC状态主键
     * @return 设备状态-PCC状态
     */
    @Override
    public DeviceStatusPcc selectDeviceStatusPccById(Long id)
    {
        return deviceStatusPccMapper.selectDeviceStatusPccById(id);
    }

    /**
     * 查询设备状态-PCC状态列表
     * 
     * @param deviceStatusPcc 设备状态-PCC状态
     * @return 设备状态-PCC状态
     */
    @Override
    public List<DeviceStatusPcc> selectDeviceStatusPccList(DeviceStatusPcc deviceStatusPcc)
    {
        return deviceStatusPccMapper.selectDeviceStatusPccList(deviceStatusPcc);
    }

    /**
     * 新增设备状态-PCC状态
     * 
     * @param deviceStatusPcc 设备状态-PCC状态
     * @return 结果
     */
    @Override
    public int insertDeviceStatusPcc(DeviceStatusPcc deviceStatusPcc)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(deviceStatusPcc.getId())) {
            deviceStatusPcc.setId(uuid);
        }
        deviceStatusPcc.setCreateBy(SecurityUtils.getUsername());
        deviceStatusPcc.setCreateTime(DateUtils.getNowDate());
        deviceStatusPcc.setUpdateBy(SecurityUtils.getUsername());
        deviceStatusPcc.setUpdateTime(DateUtils.getNowDate());
        return deviceStatusPccMapper.insertDeviceStatusPcc(deviceStatusPcc);
    }

    /**
     * 修改设备状态-PCC状态
     * 
     * @param deviceStatusPcc 设备状态-PCC状态
     * @return 结果
     */
    @Override
    public int updateDeviceStatusPcc(DeviceStatusPcc deviceStatusPcc)
    {
        deviceStatusPcc.setUpdateBy(SecurityUtils.getUsername());
        deviceStatusPcc.setUpdateTime(DateUtils.getNowDate());
        return deviceStatusPccMapper.updateDeviceStatusPcc(deviceStatusPcc);
    }

    /**
     * 批量删除设备状态-PCC状态
     * 
     * @param ids 需要删除的设备状态-PCC状态主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusPccByIds(Long[] ids)
    {
        return deviceStatusPccMapper.deleteDeviceStatusPccByIds(ids);
    }

    /**
     * 删除设备状态-PCC状态信息
     * 
     * @param id 设备状态-PCC状态主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusPccById(Long id)
    {
        return deviceStatusPccMapper.deleteDeviceStatusPccById(id);
    }
}
